﻿@using dsc.CalendarWidget.Models;
@using Orchard.ContentManagement;
@using System.Globalization;

@{
    CalendarEventDefinition ev = Model.ContentPart;
    CultureInfo ci = new CultureInfo(WorkContext.CurrentCulture);
}

<section>
    @{
        if (Model.IsAllDay)
        {
            @T("This event occurs all day at <i>{0}</i>", ev.StartDateTime.Value.ToString("d", ci))
            if (ev.StartDateTime.Value.Date != ev.EndDateTime.Value.Date)
            {
                // one empty line important here
                
                @T("and lasts until <i>{0}</i>", ev.EndDateTime.Value.ToString("d", ci))
            }
        }
        else
        {
            @T("This event occurs at <i>{0}</i>", ev.StartDateTime.Value.ToString("g", ci))
        
            // one empty line important here
                
            @T("and lasts until <i>{0}</i>", ev.EndDateTime.Value.ToString("g", ci))
        }
    }

    @{
        if (Model.IsRecurring)
        { @T(" it is recurring");
        }
        else
        { @T(" it is not recurring");
        }
    }
</section>
